<!DOCTYPE html>
<html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-0 vector-toc-not-available vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-0 vector-feature-night-mode-enabled skin-theme-clientpref-os vector-sticky-header-enabled" lang="fr" dir="ltr"><head>
<meta charset="UTF-8">
<title>Cls (commande)</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="./_res_/favicon.png">
<link rel="canonical" href="https://fr.wikipedia.org/wiki/Cls_(commande)"> <link href="./_mw_/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.wikimediamessages.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./_mw_/site.styles.css">
<link rel="stylesheet" type="text/css" href="./_mw_/noscript.css">
<link rel="stylesheet" type="text/css" href="./_res_/footer.css">
<link rel="stylesheet" type="text/css" href="./_res_/vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Cls_commande rootpage-Cls_commande skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">cls (commande)</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="contentSub">
<div id="mw-content-subtitle"></div>
</div>
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="fr" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="fr" dir="ltr"><p class="mw-empty-elt">
</p>
<p>En <a href="Informatique" title="Informatique">informatique</a>, la <a href="Commande_informatique" title="Commande informatique">commande</a> <tt><b>cls</b></tt> (pour <i><span class="lang-en" lang="en"><span style="text-decoration: underline;">cl</span>ear <span style="text-decoration: underline;">s</span>creen</span></i> en anglais) est utilisée pour effacer l'affichage. Elle est disponible avec <a href="Interface_en_ligne_de_commande" title="Interface en ligne de commande">l'interface en ligne de commande</a> de nombreux <a href="Syst%C3%A8me_d'exploitation" title="Système d'exploitation">systèmes d'exploitation</a><sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> mais aussi en tant <a href="Instruction_informatique" title="Instruction informatique">qu'instruction</a> avec certains <a href="Langage_de_programmation" title="Langage de programmation">langages de programmation</a> comme le <a href="BASIC" class="mw-redirect" title="BASIC">BASIC</a><sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Fonctionnement">Fonctionnement</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Langage_BASIC">Langage BASIC</h3></div>
<p>Pour le langage de programmation <a href="BASIC" class="mw-redirect" title="BASIC">BASIC</a>, l'instruction <code><b>CLS</b></code> (noté en majuscule avec les premières versions du langage) est traduite par <a href="Interpr%C3%A8te_(informatique)" title="Interprète (informatique)">l'interpréteur</a> en <a href="Programmation_informatique" title="Programmation informatique">routine</a> compréhensible par la machine.
</p>
<div class="mw-heading mw-heading3"><h3 id="MS-DOS">MS-DOS</h3></div>
<p><tt>cls</tt> est une commande interne au programme <a href="COMMAND.COM" class="mw-redirect" title="COMMAND.COM">command.com</a>. Ce programme est <a href="Interpr%C3%A9teur_de_commandes" title="Interpréteur de commandes">l’interpréteur</a> des commandes internes et externes du système MS-DOS.
</p><p>L’interpréteur efface l'écran de la <a href="Terminal_informatique" class="mw-redirect" title="Terminal informatique">console</a> de commande après avoir validé avec la <a href="Touche_entr%C3%A9e" class="mw-redirect" title="Touche entrée">touche entrée</a> la saisie de la commande <code>cls</code> dans cette même console. L’exécution de la commande <code>cls</code> peut aussi être planifiée à l'aide d'un <a href="Langage_de_script" title="Langage de script">script</a> <a href=".bat" title=".bat">batch</a>.
</p>
<div class="mw-heading mw-heading3"><h3 id="Windows_NT">Windows NT</h3></div>
<p>À partir de <a href="Windows_NT" title="Windows NT">Windows NT</a>, <code>cls</code> est une commande interne à l'interpréteur <a href="Cmd.exe" class="mw-redirect" title="Cmd.exe">cmd.exe</a>. Son fonctionnement est identique à la commande de l’interpréteur MS-DOS.
</p>
<div class="mw-heading mw-heading3"><h3 id="Windows_PowerShell">Windows PowerShell</h3></div>
<p>Pour l’interpréteur de commande <a href="Windows_PowerShell" title="Windows PowerShell">Windows PowerShell</a>, <code>cls</code> est un <a href="Alias_(informatique)" class="mw-redirect" title="Alias (informatique)">alias</a> de la <a href="Windows_PowerShell#Origine_du_nom_de_code" title="Windows PowerShell">commandelette</a> <code><b>Clear-Host</b></code>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Notes_et_références"><span id="Notes_et_r.C3.A9f.C3.A9rences"></span>Notes et références</h2></div>
<div class="references-small decimal" style=""><div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a> </span><span class="reference-text"><span class="ouvrage">« <a rel="nofollow" class="external text" href="https://technet.microsoft.com/fr-fr/library/cc732812(v=ws.10).aspx"><cite style="font-style:normal;">Commande cls</cite></a> », sur <span class="italique">Microsoft TechNet</span> <small style="line-height:1em;">(consulté le <time class="nowrap" datetime="2012-06-26" data-sort-value="2012-06-26">26 juin 2012</time>)</small></span>.</span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a> </span><span class="reference-text"><span class="ouvrage">« <a rel="nofollow" class="external text" href="http://www.progmatique.fr/article-38-Basic-introduction-langage.html"><cite style="font-style:normal;">Introduction au langage BASIC</cite></a> », sur <span class="italique">ProgMatique</span> <small style="line-height:1em;">(consulté le <time class="nowrap" datetime="2012-06-26" data-sort-value="2012-06-26">26 juin 2012</time>)</small></span>.</span>
</li>
</ol></div>
</div>
<div class="mw-heading mw-heading2"><h2 id="Voir_aussi">Voir aussi</h2></div>
<ul><li><a href="Clear_(Unix)" title="Clear (Unix)">clear (Unix)</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="Liens_externes">Liens externes</h2></div>
<style data-mw-deduplicate="TemplateStyles:r194021218">
/* start https://fr.wikipedia.org/ */
.mw-parser-output .autres-projets>.titre{text-align:center;margin:0.2em 0}.mw-parser-output .autres-projets>ul{margin:0;padding:0}.mw-parser-output .autres-projets>ul>li{list-style:none;margin:0.2em 0;text-indent:0;padding-left:24px;min-height:20px;text-align:left;display:block}.mw-parser-output .autres-projets>ul>li>a{font-style:italic}@media(max-width:720px){.mw-parser-output .autres-projets{float:none}}
/* end https://fr.wikipedia.org/ */
</style>
<div class="navbox-container" style="clear:both;">
</div>
<ul id="bandeau-portail" class="bandeau-portail"><li><span class="bandeau-portail-element"><span class="bandeau-portail-icone"><span class="noviewer" typeof="mw:File"></span></span> <span class="bandeau-portail-texte">Portail de l’informatique</span> </span></li> </ul></div><!--htdig_noindex--><div><div class="zim-footer">
Cet article est issu de <a class="external text" title="Dernière modification le 2024-11-10" href="https://fr.wikipedia.org/wiki/?title=Cls_(commande)&oldid=220171608">Wikipédia</a>. Sauf mention contraire, le texte est disponible sous <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.fr">Creative Commons Attribution-Share Alike 4.0</a>. Des conditions supplémentaires peuvent s’appliquer aux fichiers multimédias.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
<script src="./_webp_/webpHandler.js"></script>
</body></html>